#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, k;
	int sum1 = 0, sum2 = 0;
	int count1 = 0, count2 = 0;
	cin >> n >> k;
	for (int i = 1; i <= n; ++i) {
		if (i % k == 0 && i >= k) {
			sum1 += i;
			count1++;
		} else {
			sum2 += i;
			count2++;
		}
	}
	printf("%.1lf %.1lf", sum1 * 1.0 / count1, sum2 * 1.0 / count2);
	return 0;
}